package com.sg.file.transform.provider.event;

import com.sg.file.transform.api.dto.TransformReqeust;
import lombok.Getter;
import lombok.Setter;
import org.springframework.context.ApplicationEvent;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 文件异步转换事件
 * Created by asus on 2018/7/19.
 */
@Getter
@Setter
public class AsynFileTransformEvent extends ApplicationEvent{

    private static final long serialVersionUID = -2292422869410823506L;
    //异步文件转换请求
    private List<TransformReqeust> transformReqeusts = new ArrayList<>();

    public AsynFileTransformEvent(Object source, TransformReqeust transformReqeust) {
        super(source);
        this.transformReqeusts.add(transformReqeust);
    }


    public AsynFileTransformEvent(Object source, TransformReqeust[] transformReqeusts) {
        super(source);
        this.transformReqeusts.addAll(Arrays.asList(transformReqeusts));
    }
}
